package com.example.stream;

import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;

public class FileStream {
    public static void main(String[] args) throws IOException {
        Files.list(Paths.get("/Users/jinyu/ja-netfilter-all")).forEach(path -> {
            System.out.println(path);
            if(path.getFileName().endsWith("readme.txt")){
                try {
                    Files.lines(path).forEach(content->{
                        System.out.println(content);
                    });
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        });
    }
}
